<%-- 
    Document   : OrderList
    Created on : 2014/3/3, 上午 10:18:18
    Author     : Gjun
--%>

<%@page import="java.util.ArrayList"%>
<%@page import="java.util.HashMap"%>
<%@page import="Filter.DAO"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<style type="text/css">
    #Table1 {border-width:1px ; border-style: solid;}
    #Table1 thead { background-color:#854806; color: white; font-weight:bold; }
    #Table1 td{ padding:10px; text-align:center;}
   
</style>

<%
    String num ="0";
    
    String sql="SELECT * from order_detail";
    DAO dao =new DAO(); 
    if (request.getParameter("num")!=null && request.getParameter("num")!="")
        num = Integer.toString(Integer.parseInt(request.getParameter("num"))*5);      
    //取資料
    ArrayList<HashMap> rslist= dao.query2(sql, new String[]{}, num , "1000");
    int fin=dao.GGININ()/Integer.parseInt("1000");
    if(dao.GGININ()%Integer.parseInt("1000")==0)
        fin--;
%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <table id="Table1" border="1">
            <thead>
                <tr>
                    <th>產品編號</th>                                                 
                    <th>產品價格</th>                   
                    <th>數量</th>
                    
                </tr>
            </thead>
            <tbody>
            <%
                for(int i =0;i<rslist.size();i++)
                {
                    HashMap map =rslist.get(i);
                    out.println("<tr><td>"+map.get("product_id")+                                                                                  
                            "</td><td>"+map.get("product_price")+                           
                            "</td><td>"+map.get("order_quantity")+
                            "</td></tr>");
                }
                out.println("<tr><a href='ProductManagement.jsp'>返回產品管理列表</a></tr>");
            %>            
            </tbody>
           
    </body>
</html>
